<!-- 产品类型 -->
    <script type="text/html" template>
        <link rel="stylesheet" href="{{ layui.setter.base }}style/alert.css">
        <link rel="stylesheet" href="{{ layui.setter.base }}style/alert-form.css">
        <link rel="stylesheet" href="{{ layui.setter.base }}style/autoComplete.css">
    </script>
   <style scoped>
       .row .layui-form-label{
           min-width: 60px;
       }
   </style>
    <div class="layui-form layui-fluid row" lay-verify="changeOrder">
        <div class="layui-form-item">
            <label class="layui-form-label">原保养人：</label>
            <div class="layui-input-block">
                <input type="text" name="tcCatgCode"  class="layui-input inner" disabled style="border: 0;">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">原截止时间：</label>
            <div class="layui-input-block">
                <input type="text" name="tcCatgCode"  class="layui-input inner" disabled style="border: 0;">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新保养人：</label>
            <div class="layui-input-block">
                <select name="gen01" required lay-verify="required" placeholder="" id="gen02"
                autocomplete="off"  lay-search>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">新截止时间：</label>
            <div class="layui-input-block">
                <input type="text" name="fil13" required lay-verify="required" placeholder="" id="newTime"
                autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="footer layui-form-item layui-fluid" style="margin-top: 30px;">
            <button data-lang="confirm" class="btn1 layui-btn layui-btn-radius layui-btn-primary"
                lay-filter="LAY-submit-qd" lay-submit>确定</button>
            <button data-lang="cancel" class="btn2 layui-btn layui-btn-radius layui-btn-primary">取消</button>
        </div>
    </div>
<script>
    layui.use(['form', 'table', 'api', 'utill', 'laydate', 'jquery'], function () { //此段代码必不可少
        var table = layui.table,
            setter = layui.setter,
            laytpl = layui.laytpl,
            api = layui.api,
            utill = layui.utill,
            form = layui.form,
            admin = layui.admin,
            view = layui.view,
            element = layui.element,
            form = layui.form,
            $ = layui.jquery,
            laydate = layui.laydate;
            laydate.render({
                elem: '#newTime', //指定元素
                trigger: 'click',  //解决点击一闪而过
                type: 'datetime'
            })
    // 模糊匹配
    var tableArray=parent.tableArray;
    var userUrl='';
    if(tableArray[0].fil04=='巡检工单'){
        userUrl='/fil/UserSelectAllUser1.json'
    }else if(tableArray[0].fil04=='保养工单'){
        userUrl='/fil/UserSelectAllUser2.json'
    }
    admin.req({
        url: api.host + userUrl,
        type: 'POST',
        contentType: 'application/json',
        done: function (res) {
            var str = '<option value=""></option>'
            for (let index = 0; index < res.data.length; index++) {
                str = str +
                `<option value="${res.data[index].gen01}">${res.data[index].gen02}</option>`
            }
            $('#gen02').append(str)
            form.render();
        }
    });
    //取消
    $('.footer').on('click', '.btn2', function () {
       layer.closeAll()
    });
    });
</script>